/*
 * #%L
 * java model
 * %%
 * Copyright (C) 2009 - 2011 prefabware.com Stefan Isele
 * %%
 * All Rights Reserved.
 * This program is dual-licensed under the GNU General Public license
 * or a commercial license.
 * You may select to use one or the other of these licenses.
 * To obtain a commercial license please contact Stefan Isele at www.stefan-isele.de
 * Any modifications to this file must keep this entire header intact.
 * Redistribution, except as permitted by the selected license, is prohibited.
 * #L%
 */
package com.prefabware.jmodel;

import com.prefabware.jmodel.code.JCodeOptions;
import com.prefabware.jmodel.expression.JLeftHandSideExpression;
import com.prefabware.jmodel.expression.JVariable;
import com.prefabware.jmodel.expression.JVariableDeclaration;
import com.prefabware.jmodel.javadoc.JArgumentJavadoc;

public class JArgument implements JLeftHandSideExpression {
	private JVariable variable;

	public JVariableDeclaration getDeclaration() {
		return variable.getDeclaration();
	}

	public JArgumentJavadoc getJavadoc() {
		return javadoc;
	}

	public void setJavadoc(JArgumentJavadoc javadoc) {
		this.javadoc = javadoc;
	}

	protected JArgumentJavadoc javadoc;

	/**
	 * @param declaration
	 *            , type and name of the parameter
	 */
	public JArgument(JVariable variable) {
		super();
		this.variable=variable;
		this.javadoc = new JArgumentJavadoc();
	}

	public String getName() {
		return this.variable.getDeclaration().getName();
	}


	
	@Override
	public String asCode(JCodeOptions options) {
		return this.getName();
	}

}
